<template>
	<div>
		<button @click="getStudentInfo">点我获取学生信息</button>
		<button @click="getCarInfo">点我获取汽车信息</button>
	</div>
</template>

<script>
	import axios from 'axios'

	export default {
		name: 'App',
		methods: {
			getStudentInfo() {
				axios.get('http://localhost:8080/students/students').then(
					response => {
						console.log(response.data);
					},
					err => {
						console.log(err);
					}
				)
			},
			getCarInfo() {
				axios.get('http://localhost:8080/cars/cars').then(
					response => {
						console.log(response.data);
					},
					err => {
						console.log(err);
					}
				)
			}
		}
	}
</script>